import 'package:e_book/components/book_detail_tile/my_book_detail_tile_skeleton.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class MyBookDetailTitle extends StatelessWidget {
  final List<dynamic>? data;
  final List<dynamic> labels;

  const MyBookDetailTitle({super.key, this.data, required this.labels});

  @override
  Widget build(BuildContext context) {
    return Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: List.generate(labels.length, (index) {
          if (data == null) {
            return MyBookDetailTitleSkeleton(label: labels[index]);
          }
          return SizedBox(
            width: 100.w,
            child: Column(
              children: [
                Text(
                  data![index],
                  style:
                      TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w600),
                ),
                3.verticalSpace,
                Text(
                  labels[index],
                  style: TextStyle(
                    fontSize: 14.sp,
                    color: Theme.of(context).colorScheme.inversePrimary,
                  ),
                ),
              ],
            ),
          );
        }));
  }
}
